﻿
/***************************************************************************

Copyright (c) Microsoft Corporation. All rights reserved.
This code is licensed under the Visual Studio SDK license terms.
THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

***************************************************************************/

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;

namespace Microsoft.Samples.VisualStudio.IronPythonProject
{
    /// <summary>
    /// Creates Python Projects
    /// </summary>
    [Guid(GuidList.guidPythonProjectFactoryString)]
    public class PythonProjectFactory : Microsoft.VisualStudio.Package.ProjectFactory
    {
        #region ctor
        /// <summary>
        /// Constructor for PythonProjectFactory
        /// </summary>
        /// <param name="package">the package who created this object</param>
        public PythonProjectFactory(PythonProjectPackage package)
            : base(package)
        {
        }
        #endregion

        #region overridden methods
        /// <summary>
        /// Creates the Python Project node
        /// </summary>
        /// <returns>the new instance of the Python Project node</returns>
        protected override Microsoft.VisualStudio.Package.ProjectNode CreateProject()
        {
            PythonProjectNode project = new PythonProjectNode(this.Package as PythonProjectPackage);
            project.SetSite((IOleServiceProvider)((IServiceProvider)this.Package).GetService(typeof(IOleServiceProvider)));
            return project;
        }
        #endregion
    }
}
